<div id="templatemo_main_top"></div>
<div id="templatemo_main">
    <div class="col_12 float_l">
        <div id="search-widget">
            
            {if $logged === false}   
                <form action="login.php#login" method="post" onsubmit="document.getElementById('current_url').value=document.URL">
                    <table>
                        {if $created === true}
                        <tr>
                            <td colspan="2"><label style="color:lightgreen;">Your account was successfully created!</label></td>
                        </tr>
                        {/if}
                        <tr>
                            <td colspan="2"><label style="font-style: italic">Enter your user name and password below to access your acount...</label></td>
                        </tr>
                        <tr id="login_error" style="visibility:hidden">
                            <td colspan="2"><label style="color:red;">Invalid user name or password!</label></td>
                        </tr>
                        <tr>
                            <td><label>User name</label></td>
                            <td><input id="user" onfocus="clearUserInput(this.value,1);" onblur="clearUserInput(this.value,2);" type="text" name="user" value="{$formUserValue}" /></td>
                        </tr>
                        <tr>
                            <td>Password</td>
                            <td><input type="password" name="pass" /></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td>

                                {if $userReferred === true}                        
                                    <input name="currentPage"       type="hidden" value="{$currentPage}">
                                    <input name="hotelId"           type="hidden" value="{$hotelID}">
                                    <input name="supplierType"      type="hidden" value="{$supplierType}">
                                    <input name="roomRateKey"       type="hidden" value="{$roomRateKey}">
                                    <input name="roomRateCode"      type="hidden" value="{$roomRateCode}">
                                    <input name="roomTypeCode"      type="hidden" value="{$roomTypeCode}">
                                    <input name="hotelImage"        type="hidden" value="{$hotelImage}">
                                    <input name="hotelName"         type="hidden" value="{$hotelName}">
                                    <input name="roomDescription"   type="hidden" value="{$roomDescription}">
                                    <input name="total"             type="hidden" value="{$total}">
                                    <input name="averageRate"       type="hidden" value="{$averageRate}">
                                    <input name="roomtotal"         type="hidden" value="{$roomtotal}"/>
                                    <input name="nightlyRateTotal"  type="hidden" value="{$nightlyRateTotal}"/>
                                    <input name="surchargeTotal"    type="hidden" value="{$surchargeTotal}"/>
                                    <input name="currencyCode"      type="hidden" value="{$currencyCode}"/>
                                {/if}
                                <input type="hidden" name="current_url" id="current_url" value="" />        
                                <input style="margin-top:20px;float:left;" id="search_button" type="submit" value="login" />
                            </td>
                        </tr>
                    </table>
                </form>
                <form action="create_account.php" method="post" onsubmit="document.getElementById('current_url').value=document.URL">
                    {if $userReferred === true}
                        <input name="currentPage"       type="hidden" value="{$currentPage}">
                        <input name="hotelId"           type="hidden" value="{$hotelID}">
                        <input name="supplierType"      type="hidden" value="{$supplierType}">
                        <input name="roomRateKey"       type="hidden" value="{$roomRateKey}">
                        <input name="roomRateCode"      type="hidden" value="{$roomRateCode}">
                        <input name="roomTypeCode"      type="hidden" value="{$roomTypeCode}">
                        <input name="hotelImage"        type="hidden" value="{$hotelImage}">
                        <input name="hotelName"         type="hidden" value="{$hotelName}">
                        <input name="roomDescription"   type="hidden" value="{$roomDescription}">
                        <input name="total"             type="hidden" value="{$total}">
                        <input name="averageRate"       type="hidden" value="{$averageRate}">
                        <input name="roomtotal"         type="hidden" value="{$roomtotal}"/>
                        <input name="nightlyRateTotal"  type="hidden" value="{$nightlyRateTotal}"/>
                        <input name="surchargeTotal"    type="hidden" value="{$surchargeTotal}"/>
                        <input name="currencyCode"      type="hidden" value="{$currencyCode}"/>
                        <input name="accountCreation"   type="hidden" value="TRUE"/>
                    {/if}
                    <input type="submit" value="Create new account..." id="newCreateAccountButton" />                   
                    
                </form>
            {else}  
    <div style="height:100px;">
    <label>Hello {$username}, you can proceed to your <a style="color:white;font-weight:bold;" href="underConstruction.php">account</a>.</label><br />
        <input style="margin-top:20px;float:left;" id="search_button" type="button" value="logout" onclick="document.location='login.php?logout=true'" />    
    </div>    
    
{/if}    
        </div>            
    </div>
    <div class="col_12 float_r">
    	<h2>Top Deals</h2>
        <img src="images/templatemo_image_02.jpg" alt="Image 02" class="float_l img_float_l" />
        <p><em>Check out our best hotels deals for the best touristic sites in London, San Francisco, Florida, New York, etc.</em></p>
        <p></p>
    </div>
    <div class="cleaner"></div>
</div> <!-- END of main -->
<a name="login"></a>
<script type="text/javascript">
    function clearUserInput(value,type) {
        if(type==1 && value=="{$formUserValue}") document.getElementById("user").value="";
        if(type==2 && value=="") document.getElementById("user").value="{$formUserValue}";        
}
</script>    